<template>
    <el-dialog
        class="dialog"
        :destroy-on-close="true"
        title="园区二维码"
        :visible.sync="isShow"
        :close-on-click-modal="false"
        @close="onDialogClose">
        <el-form
            ref="form"
            label-width="auto"
            class="form"
            :model="formData"
        >
            <el-form-item label="代理商名称">
                {{formData.agent_name}}
            </el-form-item>
            <el-form-item  prop="param1">
                <vue-qr
                ref="qrcode"
                colorLight="#fff"
                :text="formData.param1"
                :margin="0"
                :logoScale="0.3"
                :size="300"
            ></vue-qr>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="onDialogClose">关闭</el-button>
        </div>
    </el-dialog>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import vueQr from "vue-qr";
import { mixinDialogForm } from "@/mixin/dialog/Form";
@Component({
    mixins: [mixinDialogForm],
    components: {
        vueQr
    }
})
export default class agentYardStr extends Vue {
    editInit(data: any) {
        this.formData.agent_name = data.agent_name;
        this.formData.param1 = 'https://wyapp.park.hy-access.com/agent-yard/?code=' + data.agent_code;
    }

    // 表单数据
    formData: any = {
        param1: "",
        agent_name: "",
        yard_sn: ""
    };
}
</script>
